/*
 * Copyright (c) 2022-2022 All rights Reserved.
 */

package com.driving.core;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.injector.ISqlInjector;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;

/**
 * Mybatis-Plus配置
 *
 * @author SAGITTAR
 * @since 2017
 */
@Configuration
public class MybatisPlusConfigurer {

    /**
     * 注册分页插件
     *
     * @return 分页插件
     */
    @Bean
    PaginationInnerInterceptor paginationInnerInterceptor() {
        return new PaginationInnerInterceptor();
    }

    /**
     * SQL注入器
     *
     * @return 默认SQL注入器
     */
    @Bean
    ISqlInjector sqlInjector() {
        return new DefaultSqlInjector();
    }
}
